<template>
	<div class="app-container">
		<el-table :data="teachBook" border style="width: 100%;">
			<el-table-column fixed type="selection" width="55"></el-table-column>
		    <el-table-column prop="lession.lession_name" label="名称" width="120"></el-table-column>
		    <el-table-column prop="lession.lession_type" label="课程类型" width="120">
				<template slot-scope="scope">
					<div v-if="scope.row.lession.lession_type == 1">线上</div>
					<div v-if="scope.row.lession.lession_type == 2">线下</div>
				</template>
			</el-table-column>
		    <el-table-column prop="clbum.begin_time" label="开课时间"></el-table-column>
		    <el-table-column prop="clbum.end_time" label="结束时间"></el-table-column>
		    <el-table-column prop="" label="上课时间"></el-table-column>
		    <el-table-column fixed="right" label="操作" width="180">
		      <template slot-scope="scope">
		        <el-button @click="msg(scope.row)" type="primary" size="small">信息</el-button>
				<el-button @click="shopcar(scope.row)" type="warning" size="small">加入购物车</el-button>
		      </template>
		    </el-table-column>
		</el-table>
	</div>
</template>

<script>
import { queryPayLession } from '@/api/studentRecruit.js'
export default{
	data(){
		return{
			msgData:[], //查看信息
		}
	},
	created() {
		
	},
	methods:{
		msg(row){
			console.log('信息',row);
			this.msgData.push(row)
			console.log('msgData',this.msgData);
		},
		shopcar(row){
			row.type = 1
			row.pay_num = 1
			let resData = {
				unid:row.unid,
				lession_name:row.lession.lession_name,
				type:row.type,
				pay_num:row.pay_num,
				price:row.price*row.pay_num,
			}
			this.shopcarlist(resData)
		}
	},
	props:{
		teachBook:{
			type: Array,
			default:[]
		},
		shopcarlist:{
			type:Function,
			default:() => {}
		}
	}
}
</script>

<style lang="scss">

</style>
